import 'dart:convert';

List<HelpDocItem> helpDocItemFromJson(String str) => List<HelpDocItem>.from(
    json.decode(str).map((x) => HelpDocItem.fromJson(x)));

String helpDocItemToJson(List<HelpDocItem> data) =>
    json.encode(List<dynamic>.from(data.map((x) => x.toJson())));

class HelpDocItem {
  HelpDocItem({
    this.image,
    this.name,
    this.title,
    this.key,
    this.type,
    this.helpText,
    this.helpItems,
  });

  String? image;
  String? name;
  HelpText? title;
  String? key;
  int? type;
  HelpText? helpText;
  List<HelpDocItem>? helpItems;

  factory HelpDocItem.fromJson(Map<String, dynamic> json) => HelpDocItem(
        image: json["image"] == null ? null : json["image"],
        name: json["name"] == null ? null : json["name"],
        title: json["title"] == null ? null : HelpText.fromJson(json["title"]),
        key: json["key"] == null ? null : json["key"],
        type: json["type"],
        helpText: json["helpText"] == null
            ? null
            : HelpText.fromJson(json["helpText"]),
        helpItems: json["helpItems"] == null
            ? null
            : List<HelpDocItem>.from(
                json["helpItems"].map((x) => HelpDocItem.fromJson(x))),
      );

  Map<String, dynamic> toJson() => {
        "image": image == null ? null : image,
        "name": name == null ? null : name,
        "title": title == null ? null : title?.toJson(),
        "key": key == null ? null : key,
        "type": type,
        "helpText": helpText == null ? null : helpText?.toJson(),
        "helpItems": helpItems == null
            ? null
            : List<dynamic>.from(helpItems!.map((x) => x.toJson())),
      };
}

class HelpText {
  HelpText({
    this.cn,
    this.en,
    this.tc,
  });

  String? cn;
  String? en;
  String? tc;

  factory HelpText.fromJson(Map<String, dynamic> json) => HelpText(
        cn: json["cn"],
        en: json["en"],
        tc: json["tc"],
      );

  Map<String, dynamic> toJson() => {
        "cn": cn,
        "en": en,
        "tc": tc,
      };
}
